package com.base.mybaseproject.univerimgLoad;

import android.widget.ImageView;

import com.base.mybaseproject.imgLoad.core.DisplayImageOptions;
import com.base.mybaseproject.imgLoad.core.ImageLoader;
import com.base.mybaseproject.imgLoad.core.assist.ImageLoadingListener;
import com.base.mybaseproject.imgLoad.core.assist.display.RoundedBitmapDisplayer;
import com.example.mybaseproject.R;

public class ImgLoader extends ImageLoader {

	private volatile static ImgLoader instance;

	public static ImgLoader getInstance() {
		if (instance == null) {
			synchronized (ImageLoader.class) {
				if (instance == null) {
					instance = new ImgLoader();
				}
			}
		}
		return instance;
	}

	protected ImgLoader() {
	}

	DisplayImageOptions options = new DisplayImageOptions.Builder().showStubImage(R.drawable.ic_stub) // 默认图片

			.showImageForEmptyUri(R.drawable.ic_empty) // 空URL

			.showImageOnFail(R.drawable.ic_error)// 加载失败

			.cacheInMemory(true).cacheOnDisc(true).displayer(new RoundedBitmapDisplayer(20)).build();

	@Override
	public void displayImage(String uri, ImageView imageView) {
		super.displayImage(uri, imageView);
	}

	@Override
	public void displayImage(String uri, ImageView imageView, DisplayImageOptions options) {
		this.options=options;
		super.displayImage(uri, imageView, options);
	}

	@Override
	public void displayImage(String uri, ImageView imageView, ImageLoadingListener listener) {
		// TODO Auto-generated method stub
		super.displayImage(uri, imageView, listener);
	}

	@Override
	public void displayImage(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener) {
		// TODO Auto-generated method stub
		super.displayImage(uri, imageView, options, listener);
	}

}
